package com.z.sys.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("${api}")
@Api(tags = "通用API")
@Slf4j
public class ApiController {

    @GetMapping("toPage")
    @ApiOperation("跳转页面")
    public String toPage(String m, String p) {
        return "/" + m + "/" + p;
    }

    @GetMapping("{model}/{pageName}")
    @ApiOperation("跳转页面")
    public String toPage1(@PathVariable("model") String m, @PathVariable("pageName") String p) {
        return "/" + m + "/" + p;
    }
    @GetMapping("{model}/{model_c}/{pageName}")
    @ApiOperation("跳转页面")
    public String toPage1 (@PathVariable("model") String m, @PathVariable("model_c") String mc, @PathVariable("pageName") String p) {
        log.info("跳转 --> /" + m + "/" + mc + "/" + p);
        return "/" + m + "/" + mc + "/" + p;
    }
}
